package top.xunfong.api.probe.factory;


import top.xunfong.common.core.domain.R;
import top.xunfong.api.probe.domain.dto.ProbeDTO;
import top.xunfong.api.probe.model.RemoteProbeService;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Collection;

@Component
public class RemoteProbeFallbackFactory implements FallbackFactory<RemoteProbeService> {
    @Override
    public RemoteProbeService create(Throwable cause) {
        return new RemoteProbeService() {

            @Override
            public R<String> sendSingle(ProbeDTO dto, String source) {
                return R.fail();
            }

            @Override
            public R<String> sendMultiple(Collection<ProbeDTO> dto, String source) {
                return R.fail();
            }
        };
    }
}
